import Layout from "@/layout/index.vue";
import { createNameComponent } from "../createNode";

const route = [
  {
    //建议管理
    path: "/",
    component: Layout,
    redirect: "/proposeMgt",
    meta: {
      title: "message.menu.page.platformContentMgt.name",
      icon: "icon-page"
    },
    children: [
      {
        path: "proposeMgt",
        component: createNameComponent(
          () => import("@/views/main/platformContentMgt/proposeList.vue")
        ),
        meta: {
          title: "message.menu.page.platformContentMgt.proposeMgt",
          icon: "icon-all-application",
          roles: ["admin", "editor"],
          cache: false
        }
      }
    ]
  },
  {
    //投诉管理
    path: "/",
    component: Layout,
    meta: { title: "message.menu.page.platformContentMgt.name" },
    children: [
      {
        path: "complaintMgt",
        component: createNameComponent(
          () => import("@/views/main/platformContentMgt/complaintList.vue")
        ),
        meta: {
          title: "message.menu.page.platformContentMgt.complaintMgt",
          icon: "icon-report",
          roles: ["admin", "editor"],
          cache: false
        }
      }
    ]
  },
  {
    //事项咨询管理
    path: "/",
    component: Layout,
    meta: {
      title: "message.menu.page.platformContentMgt.name",
      icon: "icon-page"
    },
    children: [
      {
        path: "consultMgt",
        component: createNameComponent(
          () => import("@/views/main/platformContentMgt/consultList.vue")
        ),
        meta: {
          title: "message.menu.page.platformContentMgt.consultMgt",
          icon: "icon-helpcenter",
          roles: ["admin", "editor"],
          cache: false
        }
      }
    ]
  },
  {
    //详情管理
    path: "/",
    component: Layout,
    hideMenu: true,
    meta: {
      title: "message.menu.page.platformContentMgt.name",
      icon: "icon-page"
    },
    children: [
      {
        // 建议管理详情
        hideMenu: true,
        path: "proposeDetail/:id",
        component: createNameComponent(
          () => import("@/views/main/platformContentMgt/proposeDetail.vue")
        ),
        meta: {
          title: "message.menu.page.platformContentMgt.proposeDetail",
          icon: "icon-page",
          roles: ["admin", "editor"],
          cache: false
        }
      },
      {
        // 投诉管理详情
        hideMenu: true,
        path: "complaintDetail/:id",
        component: createNameComponent(
          () => import("@/views/main/platformContentMgt/complaintDetail.vue")
        ),
        meta: {
          title: "message.menu.page.platformContentMgt.complaintDetail",
          icon: "icon-page",
          roles: ["admin", "editor"],
          cache: false
        }
      },
      {
        // 事项咨询管理详情
        hideMenu: true,
        path: "consultDetail/:id",
        component: createNameComponent(
          () => import("@/views/main/platformContentMgt/consultDetail.vue")
        ),
        meta: {
          title: "message.menu.page.platformContentMgt.consultDetail",
          icon: "icon-page",
          roles: ["admin", "editor"],
          cache: false
        }
      }
    ]
  }

  // {
  //   path: '/pages',
  //   component: Layout,
  //   redirect: '/pages/crudTable',
  //   meta: { title: 'message.menu.page.name', icon: 'icon-page' },
  //   alwayShow: true,
  //   children: [
  //     {
  //       path: 'crudTable',
  //       component: createNameComponent(() => import('@/views/main/pages/crudTable/index.vue')),
  //       meta: { title: 'message.menu.page.crudTable', icon: 'icon-page', cache: false, roles: ['admin', 'editor'] }
  //     },
  //     {
  //       path: 'categoryTable',
  //       component: createNameComponent(() => import('@/views/main/pages/categoryTable/index.vue')),
  //       meta: { title: 'message.menu.page.categoryTable', cache: true, roles: ['admin'] }
  //     },
  //     {
  //       path: 'treeTable',
  //       component: createNameComponent(() => import('@/views/main/pages/treeTable/index.vue')),
  //       meta: { title: 'message.menu.page.treeTable', cache: true }
  //     }
  //   ]
  // }
];

export default route;
